home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Text⁄Files / MakeWrite / MakeWrite Folder / MWMapInfo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-06  |  2.2 KB  |  90 lines  |  [TEXT/KAHL]

  1. /*
  2.     MapInfo.h - map structures
  3. */
  4.  
  5. #ifndef    _MWMapInfo_
  6.  
  7. # define    _MWMapInfo_
  8.  
  9.  
  10.  
  11. # ifndef    nil
  12. # define    nil        (0L)
  13. # endif
  14.  
  15.  
  16. /*
  17.     Font chosen is specified by its number in FontMgr.h.  If no font
  18.     change is specified, use sameFont.
  19.     Point size is one of 9, 10, 12, 14, 18 or 24, or none.  If no
  20.     size change is specified, use sameSize.
  21. */
  22.  
  23. # define    sameFont    (-1)
  24. # define    sameSize    (-1)
  25.  
  26.  
  27. /*
  28.     Style word coded as follows:  high bit never used in a legal MacWrite
  29.     style spec, so it's used to signify "no style change".  If the high
  30.     bit is set, others can be anything, but are ignored.  If it's clear
  31.     the others are set according to the style attributes selected.  If
  32.     no attributes are selected (low 7 bits = 0), that means plain.
  33.  
  34.     Warning:  these constants are specified for convience in coding,
  35.     but the values are really hardcoded, since they're sometimes used
  36.     in non-obvious ways.  See StyleToStr for an example.
  37. */
  38.  
  39. typedef enum                /* bits used in style byte */
  40. {
  41.                             /* 0 = plain */
  42.     styleBold = 1,            /* boldface */
  43.     styleItalic = 2,        /* italic */
  44.     styleUnder = 4,            /* underline */
  45.     styleOutline = 8,        /* outline */
  46.     styleShadow = 16,        /* shadow */
  47.     styleSuper = 32,        /* superscript */
  48.     styleSub = 64,            /* subscript */
  49.     sameStyle = 128            /* high bit unused in any legal style, so */
  50.                             /* it's used to signify no style change */
  51. };
  52.  
  53.  
  54. /*
  55.     A map specification consists of the marker string to look for that
  56.     signals a format change, and the font, size and style combination
  57.     to be used to effect the change.  It also holds the beginning and
  58.     end of the selection points for editing the marker.
  59. */
  60.  
  61. # define    maxMarkLen        20    /* max number of chars in a marker */
  62.  
  63. typedef struct
  64. {
  65.     StringHandle    mark;        /* marker string */
  66.     short                selStart;    /* selection range in mark string */
  67.     short                selEnd;
  68.     short                font;        /* sameFont if no change specified */
  69.     short                size;        /* sameSize if no change specified */
  70.     short                style;        /* sameStyle if no change specified, */
  71.                                 /* 0 if plain, */
  72.                                 /* else bits = attributes selected */
  73. } MapSpec;
  74.  
  75.  
  76. /*
  77.     Structure used for holding text representation of
  78.     map specifications
  79. */
  80.  
  81. typedef struct
  82. {
  83.     Str255    markStr;
  84.     Str255    fontStr;
  85.     Str255    sizeStr;
  86.     Str255    styleStr;
  87. } MapStr;
  88.  
  89. # endif
  90.